ActionController::Routing::Routes.draw do |map|

  # RESTful Resources
  map.resources :users
  map.resources :pages do |pages|
    pages.resources :comments
  end
  map.resource :session  

  # Helper/Shortened URLs
  map.logout '/logout', :controller => 'sessions', :action => 'destroy'
  map.login '/login', :controller => 'sessions', :action => 'new'
  map.register '/register', :controller => 'users', :action => 'create'
  map.signup '/signup', :controller => 'users', :action => 'new'

  # Pretty page URL, always the last route.
  map.show_page '/:title', :controller => 'page', :action => 'show'

  # General/Fallback
  map.root :controller => 'page', :action => 'show', :title => 'FrontPage'
  map.connect ':controller/:action/:id'
  map.connect ':controller/:action/:id.:format'
end
